package base;

public class SumOfPairs {

	
	public static void main(String[] args) {
        int arr[] ={0,1,2,3,4,5,6,7,8,9,10};
        int st =0;
        int lt = arr.length-1;
        int required = 10;
        while(st<lt){
        	if(required == arr[st]+arr[lt]){
        		System.out.println(arr[st]+" "+arr[lt]);
        		st++;
        		lt--;
        	}else if(required<arr[st]+arr[lt]){
        		lt--;
        	}else{
        		st++;
        	}
        }
	}

}
